<!DOCTYPE html>
<html>
<head>
<title></title>
<#include "/header.html">

<link rel="stylesheet"
	href="${ctx}webjars/static/plugins/bootstrap/css/bootstrap-table.min.css">
<link rel="stylesheet"
	href="${ctx}webjars/static/plugins/treegrid/jquery.treegrid.css">
<script
	src="${ctx}webjars/static/plugins/bootstrap/js/bootstrap-table.min.js"></script>
<script
	src="${ctx}webjars/static/plugins/treegrid/jquery.treegrid.min.js"></script>
<script
	src="${ctx}webjars/static/plugins/treegrid/jquery.treegrid.bootstrap3.js"></script>
<script
	src="${ctx}webjars/static/plugins/treegrid/jquery.treegrid.extension.js"></script>
<script
	src="${ctx}webjars/static/plugins/treegrid/tree.table.js"></script>
</head>
<body>
	<div class="layui-card lc-admin">
		<div class="layui-card-header lc-header-admin">
			<i class="fa fa-dropbox"></i> 信息列表
		</div>
		<div id="myapp" v-cloak>
			<div v-show="showList">
				<!--<div class="grid-btn">-->
					<!--<div class="form-group col-xs-1  lc-query"-->
						<!--style="width: 160px; display: none;">-->
						<!--<select name="province" id="province" class="form-control"-->
							<!--style="width: 160px;">-->
							<!--<option value="">请选择省</option>-->
						<!--</select>-->
					<!--</div>-->
					<!--<div class="form-group col-xs-1"-->
						<!--style="width: 160px; display: none;">-->
						<!--<select name="city" id="city" class="form-control">-->
							<!--<option value="">请选择市</option>-->
						<!--</select>-->
					<!--</div>-->
					<!--<div class="form-group col-xs-1"-->
						<!--style="width: 160px; display: none;">-->
						<!--<select name="town" id="town" class="form-control">-->
							<!--<option value="">请选择县</option>-->
						<!--</select>-->
					<!--</div>-->

					<!--<a class="btn btn-default" @click="query">查询</a>-->
					<div class="grid-btn btn-group">
						<#if shiro.hasPermission("SysAreaController:save")> <a
							class="btn btn-primary" @click="fillParentIds"><i class="fa fa-plus"></i>&nbsp;填充父级ids</a>
						</#if>
				        <#if shiro.hasPermission("SysAreaController:save")> <a
							class="btn btn-primary" @click="add"><i class="fa fa-plus"></i>&nbsp;新增</a>
						</#if>
						<#if shiro.hasPermission("SysAreaController:update")> <a
							class="btn btn-info" @click="update"><i
							class="fa fa-pencil-square-o"></i>&nbsp;修改</a> </#if>						<#if shiro.hasPermission("SysAreaController:del")> <a
							class="btn btn-danger" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</a>
						</#if>
					</div>
					<!--<a class="btn btn-default" @click="query">查询</a>-->
					<!--<#if shiro.hasPermission("SysAreaController:save")>-->
					<!--<a class="btn btn-primary" @click="add"><i class="fa fa-plus"></i>&nbsp;新增</a>-->
					<!--</#if>-->
					<!--<#if shiro.hasPermission("SysAreaController:update")>-->
					<!--<a class="btn btn-primary" @click="update"><i class="fa fa-pencil-square-o"></i>&nbsp;修改</a>-->
					<!--</#if>-->
					<!--<#if shiro.hasPermission("SysAreaController:del")>-->
					<!--<a class="btn btn-primary" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</a>-->
					<!--</#if>-->
				<!--</div>-->

				<table id="areaTable" data-mobile-responsive="true"
					data-click-to-select="true">
					<thead>
						<tr>
							<th data-field="selectItem" data-checkbox="true"></th>
						</tr>
					</thead>
				</table>
			</div>

			<div v-show="!showList" class="panel panel-default">
				<div class="panel-heading">{{title}}</div>
				<form class="form-horizontal">
					<div class="form-group">
						<div class="col-sm-2 control-label">上级区域</div>
						<div class="col-sm-10">
							<input type="text" class="form-control" v-model="parentName    "
								@click="areaTree" readonly="readonly" placeholder="上级区域" />
						</div>
					</div>

					<div class="form-group">
						<div class="col-sm-2 control-label">名称</div>
						<div class="col-sm-10">
							<input type="text" class="form-control" v-model="sysArea.name"
								placeholder="名称" />
						</div>
					</div>
					<div class="form-group">
						<div class="col-sm-2 control-label">短名称</div>
						<div class="col-sm-10">
							<input type="text" class="form-control" v-model="sysArea.shortName"
								placeholder="短名称" />
						</div>
					</div>
					<div class="form-group">
						<div class="col-sm-2 control-label">区域编码</div>
						<div class="col-sm-10">
							<input type="text" class="form-control" v-model="sysArea.code"
								placeholder="区域编码" />
						</div>
					</div>
					<div class="form-group">
						<div class="col-sm-2 control-label">排序</div>
						<div class="col-sm-10">
							<input type="number" class="form-control" v-model="sysArea.orderNum"
								placeholder="排序" />
						</div>
					</div>




					<div class="form-group">
						<div class="col-sm-2 control-label">备注信息</div>
						<div class="col-sm-10">
							<textarea type="text" class="form-control" v-model="sysArea.remarks"
									  placeholder="备注信息" ></textarea>
						</div>
					</div>



					<div class="form-group">
						<div class="col-sm-2 control-label"></div>
						<input type="button" class="btn btn-primary" @click="saveOrUpdate"
							value="确定" /> &nbsp;&nbsp;<input type="button"
							class="btn btn-warning" @click="reload" value="返回" />
					</div>
				</form>
			</div>
		</div>
	</div>
	<!-- 选择菜单 -->
	<div id="areaLayer" style="display: none; padding: 20px;">
		<ul id="areaTree" class="ztree"></ul>
	</div>
	<script
		src="${ctx}webjars/static/js/modules/sys/sysarea.js?_${.now?long}"></script>
	<script
		src="${ctx}webjars/static/js/modules/sys/areaselect.js?_${.now?long}"></script>
</body>
</html>